package com.lxf.clouduser.mapper;

import com.lxf.clouduser.bean.UserBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 罗兴发
 * @data 2025/5/19 9:50
 * @description：用户持久层
 */
@Mapper
public interface UserMapper {
    int register(@Param("list")List<UserBean> list);
    UserBean login(@Param("userName") String userName,
                   @Param("pwd") String pwd);
    int updateUserByUserId(@Param("user")UserBean user);
    int updateUserStatusByUserId(@Param("userId") Integer userId,
                                 @Param("isOnline") Integer isOnline);

    List<UserBean> getUser(@Param("userId") String userId);

    List<UserBean> getRandUser(@Param("userId") String userId);

    UserBean selectByUserId(@Param("userId") String userId);

    List<UserBean> getGroupAllUserByGroupId(@Param("groupId") String groupId,
                                            @Param("isOnline") Integer isOnline);

    int updateUserPointsById(@Param("userId") Integer userId,
                             @Param("points") Integer points);

    int updateUserKfByUserId(@Param("userId") Integer userId,
                             @Param("isKf") Integer isKf,
                             @Param("kfCode") Integer kfCode);

    int setUserStatus(@Param("list") List<Integer> list,
                      @Param("sign") Integer sign);

    List<UserBean> getUserByUserIds(@Param("list") List<Integer> list);

    int updatePwdByUserId(@Param("userId") Integer userId,
                          @Param("pwd") String pwd);

    int delUserById(@Param("userId") Integer userId);
}
